const portfinder = require('portfinder');
const exec = require('child_process').exec;

portfinder.basePort = 8000;
portfinder.getPort((err, port) => {
	if (err) {
		console.log(err);
	} else {
		console.log('\x1B[36m%s\x1B[0m', '\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>');
		console.log('\x1B[33m%s\x1b[0m:', 'Your application will auto running here：http://localhost:' + port);
		console.log('\x1B[36m%s\x1B[0m', '>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n');
		exec(`anywhere ${port}`);
	}
});
